<template>
  <section>
    <h2>路由使用</h2>
    <p>路由参数name: {{ route.params.name }}</p>
    <p>路由参数age: {{ route.params.age }}</p>
    <button @click="handleClick">我要跳转</button>
  </section>
</template>
  
  <script lang="ts" setup>
import { useRouter, useRoute } from "vue-router";

const route = useRoute();
const router = useRouter();



function handleClick() {
    router.push({name: "hello-router",params: {name: "奉先",age: 18}});
}

</script>
  
  
<style scoped>
</style>